package com.lixinlei.springboot_servlet.controller.requestmapping.consumes;

import com.lixinlei.springboot_servlet.controller.argumentsresolver.RequestBody.Student;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(path = "/request/mapping/consumes")
public class ConsumesController {

    /**
     * 用于匹配 HTTP 请求头中的 Content-Type 的值；
     * @param student
     * @return
     */
    @RequestMapping(path = "/1", consumes = {MediaType.APPLICATION_JSON_VALUE})
    public String consumes1(@RequestBody Student student) {
        System.out.println("****************consumes1()");
        return "consumes1()";
    }

}
